local 可收购物品 = {
    [1]={类型="杂货",道具表={}},
    [2]={类型="宝石",道具表={}},
    [3]={类型="精魄灵石",道具表={}},
    [4]={类型="未激活的星石",道具表={}},
    [5]={类型="魔兽要诀",道具表={}},
    [6]={类型="高级魔兽要诀",道具表={}},
    [7]={类型="特殊魔兽要诀",道具表={}},
    [8]={类型="制造指南书",道具表={}},
    [9]={类型="灵饰指南书",道具表={}},
    [10]={类型="精铁,晶石",道具表={}},
    [11]={类型="召唤兽内丹",道具表={}},
    [12]={类型="法宝材料",道具表={}}
}
local 临时名称 = {"战魄","超级技能·碎片","特殊兽诀·碎片","无级别宝珠","附魔宝珠","天赋符","超简易宝珠","灵犀之屑"
,"炼兽真经","神兜兜","九转金丹","修炼果","天蚕丝"}
for i=1,#临时名称 do
    if 临时名称[i]== "战魄"  or 临时名称[i]== "附魔宝珠"then
        local 临时表 = {名称=临时名称[i],重点="160级"..临时名称[i]}
        table.insert(可收购物品[1].道具表, 临时表)
    else
        local 临时表 = {名称=临时名称[i]}
        table.insert(可收购物品[1].道具表, 临时表)
    end
end
local 临时名称 = {"星辉石","钟灵石","月亮石","太阳石","舍利子","红玛瑙","黑宝石","光芒石","神秘石"}
local 临时分类 = {"健步如飞","血气方刚","回春之术","锐不可当","心源","通真达灵","心无旁骛","风雨不动","回若金汤","气壮山河"}
for i=1,#临时名称 do
    for k=1,15 do
        if 临时名称[i]== "钟灵石" then
            for n=1,#临时分类 do
                local 临时表 = {名称=临时名称[i],重点=k.."级"..临时分类[n]}
                table.insert(可收购物品[2].道具表, 临时表)
            end
        else
            local 临时表 = {名称=临时名称[i],重点=k.."级"}
            table.insert(可收购物品[2].道具表, 临时表)
        end
    end
end
local 临时名称 = {"精魄灵石"}
local 临时类型 = {"速度","躲避","伤害","灵力","防御","气血"}
for i=1,#临时名称 do
    for k=1,15 do
        for n=1,#临时类型 do
            local 临时表 = {名称=临时名称[i],重点=k.."级"..临时类型[n]}
            table.insert(可收购物品[3].道具表, 临时表)
        end
    end
end
local 临时名称 = {1,2,3,4,5,6}
for i=1,#临时名称 do
    可收购物品[4].道具表[i] = {名称="未激活的星石",重点=取星石部位(临时名称[i])}
end

local 临时名称 = {"防御","反击","必杀","吸血","强力","偷袭","反震","法术暴击","冥思","法术波动",
             "夜战","隐身","感知","再生","法术连击","毒","幸运","连击","永恒","敏捷","神佑复生","驱鬼","鬼魂术",
             "魔之心","水攻","落岩","雷击","烈火","火属性吸收","土属性吸收","水属性吸收","雷属性吸收","迟钝","招架","神迹","精神集中","盾气","合纵","否定信仰","飞行"}
for i=1,#临时名称 do
    可收购物品[5].道具表[i] = {名称="魔兽要诀",重点=临时名称[i]}
end

local 临时名称 = {"高级防御","高级反击","高级必杀","高级吸血","高级强力","高级偷袭","高级盾气","高级神迹","高级合纵","高级招架","高级精神集中","高级反震","高级法术暴击","高级冥思","高级否定信仰","高级法术波动","高级夜战","高级隐身","高级感知","高级再生","高级法术连击","高级毒","高级幸运","高级连击","高级永恒","高级敏捷","高级神佑复生","高级驱鬼","高级鬼魂术","高级魔之心","水漫金山","泰山压顶","地狱烈火","奔雷咒","高级飞行","高级慧根"}
for i=1,#临时名称 do
    可收购物品[6].道具表[i] = {名称="高级魔兽要诀",重点=临时名称[i]}
end

local 临时名称 = {"死亡召唤","惊心一剑","苍鸾怒击","夜舞倾城","净台妙谛","龙魂","凝光炼彩","独行","诸天正法","浮云神马","须弥真言","剑荡四方",
"移花接木","出其不意","势如破竹","灵山禅语","无畏布施","灵能激发","大快朵颐","从天而降","理直气壮","津津有味","昼伏夜出","神出鬼没","溜之大吉","虎虎生风",
"八凶法阵","天降灵葫","月光","食指大动","流沙轻音","叱咤风云","神来气旺","千钧一怒","凭风借力","风起龙游","欣欣向荣","柳暗花明","乘胜追击","法术防御",
"气贯长虹","义薄云天","与生俱来","薪火相传","拘魂索命","力劈华山","善恶有报","上古灵符","顾盼生姿"}
for i=1,#临时名称 do
    可收购物品[7].道具表[i] = {名称="特殊魔兽要诀",重点=临时名称[i]}
end
local 临时名称 = {"剑","扇","锤","枪","刀","斧","环","双","飘","棒","爪","鞭","伞","巨剑","宝珠","法杖","弓弩","灯笼","项链","鞋子","男衣","女衣","头盔","发钗","腰带"}
for i=1,#临时名称 do
    for k=8,15 do
        local 临时表 = {名称="制造指南书",重点=(k*10).."级"..临时名称[i]}
        table.insert(可收购物品[8].道具表, 临时表)
    end
end
local 临时名称 = {"手镯","佩饰","戒指","耳饰"}
local 临时等级 = {6,8,10,12,14,16}
for i=1,#临时名称 do
    for n=1,#临时等级 do
        local 临时表 = {名称="灵饰指南书",重点=(临时等级[n]*10).."级"..临时名称[i]}
        table.insert(可收购物品[9].道具表, 临时表)
    end
end
local 临时名称 = {"百炼精铁","元灵晶石"}
local 临时等级 = {6,8,10,12,14,16}
for i=1,#临时名称 do
    if 临时名称[i] == "百炼精铁" then
        for k=8,15 do
            local 临时表 = {名称="百炼精铁",重点=(k*10).."级"}
            table.insert(可收购物品[10].道具表, 临时表)
        end
    elseif 临时名称[i] == "元灵晶石" then
        for n=1,#临时等级 do
            local 临时表 = {名称="元灵晶石",重点=(临时等级[n]*10).."级"}
            table.insert(可收购物品[10].道具表, 临时表)
        end
            --table.insert(可收购物品[10].道具表, 临时表)
    end
end
local 临时名称 = {"迅敏","狂怒","阴伤","静岳","擅咒","灵身","矫健","深思","钢化","坚甲","慧心","撞击","无畏","愤恨","淬毒","狙刺","连环","圣洁","灵光","神机步","腾挪劲","玄武躯","龙胄铠","玉砥柱","碎甲刃","阴阳护","凛冽气","舍身击","电魂闪","通灵法","双星爆","催心浪","隐匿击","生死决","血债偿"}
for i=1,#临时名称 do
    if i<=19 then
        可收购物品[11].道具表[i] = {名称="召唤兽内丹",重点=临时名称[i]}
    else
        可收购物品[11].道具表[i] = {名称="高级召唤兽内丹",重点=临时名称[i]}
    end
end
local 临时名称 = {"天蚕丝","玄龟板","阴沉木","麒麟血","内丹","金凤羽","补天石","龙之筋"}
local 临时五行 = {"金","木","水","火","土"}
for i=1,#临时名称 do
    for n=1,#临时五行 do
        local 临时表 = {名称=临时名称[i],重点=临时五行[n]}
        table.insert(可收购物品[12].道具表, 临时表)
    end
end


local 收购发布 = class(窗口逻辑)
local tp,zts,zts1
local insert = table.insert
local floor = math.floor
local bw1 = require("gge包围盒")(0,0,143,52)
local bw2 = require("gge包围盒")(0,0,100,22)
local box = 引擎.画矩形
local tos = 引擎.取金钱颜色
local mouseb = 引擎.鼠标弹起
local ceil = math.ceil
local min = math.min
local floor = math.floor
function 收购发布:初始化(根)
    self.ID = 187
    self.x = 130
    self.y = 100
    self.xx = 0
    self.yy = 0
    self.注释 = "商店"
    self.可视 = false
    self.鼠标 = false
    self.焦点 = false
    self.可移动 = true
    local 资源 = 根.资源
    local 按钮 = 根._按钮
    local 自适应 = 根._自适应
    self.资源组 = {
        [1] = 资源:载入("pic/界面/收购栏/收购界面.png", "图片"),
        [2] = 资源:载入('sgui.wdf',"网易WDF动画",0x10000002),
        [3] = 资源:载入('aaa.wdf',"网易WDF动画",0x10921CA7),
        [4] = 资源:载入('aaa.wdf',"网易WDF动画",0x10921CA7),
        [5] = 资源:载入("pic/界面/收购栏/道具类型.png", "图片"),
        [6] = 资源:载入("pic/界面/收购栏/浏览道具.png", "图片"),
    }
    self.按钮组 = {
        [1] = 按钮.创建(自适应.创建(18,4,16,16,4,3),0,0,4,true,true),--关闭
        [2] = 按钮.创建(自适应.创建(12,4,60,22,1,3),0,0,4,true,true,"改名"),
        [3] = 按钮.创建(自适应.创建(12,4,60,22,1,3),0,0,4,true,true,"搜索"),
        [4] = 按钮.创建(自适应.创建(12,4,60,22,1,3),0,0,4,true,true,"收摊"),
        [5] = 按钮.创建(自适应.创建(12,4,113,22,1,3),0,0,4,true,true,"发布到求购区"),
        [6] = 按钮.创建(自适应.创建(12,4,113,22,1,3),0,0,4,true,true,"删除该道具"),
        [7] = 根._滑块.创建(自适应.创建(1037,4,12,40,2,3,nil),1,14,100,2),
        [8] = 根._滑块.创建(自适应.创建(1037,4,12,40,2,3,nil),1,14,100,2),
    }
    for i=2,5 do
        self.按钮组[i]:置偏移(7,0)
    end
    self.按钮组[6]:置偏移(14,0)
    for n=1,6 do
        self.按钮组[n]:绑定窗口_(self.ID)
    end
    self.控件类 = require("ggeui/加载类")()
    local 总控件 = self.控件类:创建控件('收购发布')
    总控件:置可视(true,true)
    self.数量输入框 = 总控件:创建输入("数量输入", 0,0,50,14,根,根.字体表.华康14)
    self.数量输入框:置可视(false,false)
    self.数量输入框:置限制字数(4)
    self.数量输入框:置数字模式()
    self.数量输入框:置光标颜色(-16777216)
    self.数量输入框:置文字颜色(0xFF000000)
    self.名称输入框 = 总控件:创建输入("名称输入",0,0,92,14,根,根.字体表.华康14)
    self.名称输入框:置可视(false,false)
    self.名称输入框:置限制字数(12)
    self.名称输入框:置光标颜色(-16777216)
    self.名称输入框:置文字颜色(-16777216)
    self.单价输入框 = 总控件:创建输入("单价输入",0,0,80,14,根,根.字体表.华康14)
    self.单价输入框:置可视(false,false)
    self.单价输入框:置限制字数(12)
    self.单价输入框:置数字模式()
    self.单价输入框:置光标颜色(-16777216)
    self.单价输入框:置文字颜色(-16777216)
    self.搜索框 = 总控件:创建输入("搜索输入",0,0,150,14,根,根.字体表.华康14)
    self.搜索框:置可视(false,false)
    self.搜索框:置限制字数(18)
    self.搜索框:置光标颜色(-16777216)
    self.搜索框:置文字颜色(-16777216)
    self.商品 = {}
    self.数量 = 1
    self.单价 = 1
    self.空位 = 10
    self.求购道具选中 = 0
    self.待选类型选中 = 0
    self.待选道具选中 = 0
    self.加入 = 0
    self.加入1 = 0
    self.窗口时间 = 0
    tp = 根
    zts = 根.字体表.普通字体
    zts1 = 根.字体表.普通字体
end

function 收购发布:打开(数据)
    if self.可视 then
        self.搜索框:置可视(false,false)
        self.数量输入框:置可视(false,false)
        self.名称输入框:置可视(false,false)
        self.单价输入框:置可视(false,false)
        self.商品={}
        self.可视 = false
        self.数量 = 1
        self.单价 = 1
        self.空位 = 10
        self.求购道具选中 = 0
        self.待选类型选中 = 0
        self.待选道具选中 = 0
        self.加入 = 0
        self.加入1 = 0
    else
        insert(tp.窗口_,self)
        self.数据 = 数据.收购数据
        self.招牌名称 = self.数据.名称
        self.当前银子 = 数据.银子
        self:刷新求购道具(数据.收购数据.道具)
        self.搜索框:置可视(true,true)
        self.名称输入框:置可视(true,true)
        self.数量输入框:置可视(true,true)
        self.单价输入框:置可视(true,true)
        self.搜索框:置文本("")
        self.数量输入框:置文本("")
        self.单价输入框:置文本("")
        self.名称输入框:置文本(self.招牌名称)
        tp.运行时间 = tp.运行时间 + 1
        self.窗口时间 = tp.运行时间
        self.可视 = true
    end
end

function 收购发布:刷新求购道具(数据)
    self.数量 = 1
    self.单价 = 1
    self.空位 = 10
    self.求购道具选中 = 0
    self.商品 = {}
    for n=1,10 do
        if 数据[n] ~= nil then
            self.商品[n] = {}
            self.空位 = self.空位 - 1
            local item = 引擎.取物品(数据[n].名称)
            self.商品[n].小动画=tp.资源:载入(item[11],"网易WDF动画",item[12])
            self.商品[n].大动画=tp.资源:载入(item[11],"网易WDF动画",item[13])
            self.商品[n].单价 = 数据[n].单价+0
            self.商品[n].数量 = 数据[n].数量+0
            self.商品[n].名称 = 数据[n].名称
            self.商品[n].重点 = 数据[n].重点
        end
    end
end

function 收购发布:刷新待选道具(类型)
    self.搜索 = false
    self.待选道具选中 = 0
    self.按钮组[7]:置起始点(0)
    self.按钮组[8]:置起始点(0)
    self.待选道具 = {}
    --print(#可收购物品[类型].道具表)
    for n=1,#可收购物品[类型].道具表 do
        self.待选道具[n] = {}
        local item = 引擎.取物品(可收购物品[类型].道具表[n].名称)--_JGE_HOT_UPDATE["item_data.js"][可收购物品[类型].道具表[n].名称]
        self.待选道具[n].小动画=tp.资源:载入(item[11],"网易WDF动画",item[12])
        self.待选道具[n].大动画=tp.资源:载入(item[11],"网易WDF动画",item[13])
        self.待选道具[n].名称 = 可收购物品[类型].道具表[n].名称
        self.待选道具[n].重点 = 可收购物品[类型].道具表[n].重点
    end
end

function 收购发布:搜索待选道具(搜索名)
    self.搜索 = true
    self.待选类型选中 = 0
    self.待选道具选中 = 0
    self.按钮组[7]:置起始点(0)
    self.按钮组[8]:置起始点(0)
    local 临时表 = {}
    for i=1,#可收购物品 do
        for k,v in pairs(可收购物品[i].道具表) do
            if string.find(v.名称, 搜索名) ~= nil then
                table.insert(临时表, v)
            elseif v.重点 ~= nil and string.find(v.重点, 搜索名) ~= nil then
                table.insert(临时表, v)
            end
        end
    end
    self.待选道具 = {}
    for n=1,#临时表 do
        self.待选道具[n] = {}
        local item = 引擎.取物品(临时表[n].名称)--_JGE_HOT_UPDATE["item_data.js"][临时表[n].名称]
        self.待选道具[n].小动画=tp.资源:载入(item[11],"网易WDF动画",item[12])
        self.待选道具[n].大动画=tp.资源:载入(item[11],"网易WDF动画",item[13])
        self.待选道具[n].名称 = 临时表[n].名称
        self.待选道具[n].重点 = 临时表[n].重点
    end
end

function 收购发布:显示(dt,x,y)
    if self.按钮组[1]:事件判断() then
        self:打开()
    elseif self.按钮组[2]:事件判断() then-- 2改名
        --JGESDK:发送(3720.4,{名称=self.待选道具[self.待选道具选中].名称,重点=self.待选道具[self.待选道具选中].重点 or "",单价=单价,数量=数量})
        JGESDK:发送(3720.4,{名称=self.名称输入框:取文本()})
        --JGESDK:发送(51, 25, 44, self.名称输入框:取文本(), 1)
    elseif self.按钮组[3]:事件判断() then-- 3搜索
        if self.搜索框:取文本() ~= nil then
            self:搜索待选道具(self.搜索框:取文本())
        else
            tp.常规提示:打开("#Y/请正确的输入要搜索的名称")
        end
    elseif self.按钮组[4]:事件判断() then-- 4收摊
        self:打开()
        JGESDK:发送(3720.5)
    elseif self.按钮组[5]:事件判断() then-- 5发布到求购区
        if self.待选道具选中 ~= 0 then
            local 数量 = tonumber(self.数量输入框:取文本())
            local 单价 = tonumber(self.单价输入框:取文本())
            if 数量 == nil or 数量 > 999 or 数量 < 1 then
                tp.常规提示:打开("#Y/请正确的输入要求购的道具数量")
            elseif 单价 == nil or 单价 < 2000 or 单价 ~= tonumber(单价) or 单价 ~= 单价 or type(单价) ~= "number" then
                tp.常规提示:打开("#Y/请正确的输入要求购的道具单价")
            else
                JGESDK:发送(3720.2,{名称=self.待选道具[self.待选道具选中].名称,重点=self.待选道具[self.待选道具选中].重点 or "",单价=单价,数量=数量})
            end
        else
            tp.常规提示:打开("#Y/请先选择要求购的道具")
        end
    elseif self.按钮组[6]:事件判断() then-- 6删除该道具
        if self.求购道具选中 ~= 0 then
            JGESDK:发送(3720.3,{名称=self.求购道具选中})
        else
            tp.常规提示:打开("#Y/请先选中要删除的道具")
        end
    end
    self.焦点1 = false
    self.焦点 = false
    self.资源组[1]:显示(self.x,self.y)
    self.按钮组[1]:更新(x,y)
    for i=1,4 do
        self.按钮组[i]:更新(x,y)
    end

    self.按钮组[1]:显示(self.x+611,self.y+4)
    self.资源组[5]:显示(self.x+323,self.y+62)
    self.资源组[6]:显示(self.x+451,self.y+62)
    self.按钮组[2]:显示(self.x+184,self.y+30,true)
    self.按钮组[3]:显示(self.x+558,self.y+30,true)
    self.按钮组[4]:显示(self.x+256,self.y+407,true)
    self.按钮组[5]:更新(x,y,self.待选道具选中 ~= 0)
    self.按钮组[6]:更新(x,y,self.求购道具选中 ~= 0)
    self.按钮组[5]:显示(self.x+386,self.y+407)
    self.按钮组[6]:显示(self.x+505,self.y+407)
    zts:置颜色(0xFFFFFFFF):显示(self.x+276,self.y+4,"我的收购摊位")
    zts:置颜色(0xFFD7D6F8):显示(self.x+177,self.y+68,self.空位)
    zts:置字间距(-1)
    zts1:置字间距(-1)
    local xx,yy = 0,0
    for i=1,10 do
        if self.商品[i] ~= nil then
            local jx = self.x+xx*151+20
            local jy = self.y+yy*60+95
            self.资源组[2]:显示(jx,jy)
            bw1:置坐标(jx,jy)
            self.商品[i].小动画:显示(jx-1,jy+2)
            if self.求购道具选中 == i then
                self.资源组[3]:显示(jx+2,jy)
            end
            if self.商品[i].重点 ~= nil then
                box(jx+1,jy+36,jx+51,jy+50,0x7D101010)
                local xyl = math.floor((52-zts1:取宽度(self.商品[i].重点))/2)
            tp.字体表.描边字体12:置颜色(0xFFFFFF00):显示(jx+xyl,jy+35,self.商品[i].重点)
            end
            tp.字体表.描边字体12:置颜色(0xFFFFFFFF):显示(jx+1,jy-1,self.商品[i].数量)
            zts:置颜色(0xFF202336):显示(jx+53,jy+8,self.商品[i].名称)
            zts:置颜色(tos(self.商品[i].单价)):显示(jx+53,jy+30,self.商品[i].单价)
            if bw1:检查点(x,y) and not tp.消息栏焦点 and self.鼠标 then
                self.焦点 = true
                self.焦点1 = true
                self.资源组[4]:显示(jx+2,jy)
                if mouseb(0) and self.求购道具选中 ~= i then
                    self.求购道具选中 = i
                end
            end
            xx = xx + 1
            if xx == 2 then
                xx = 0
                yy = yy + 1
            end
        end
    end
    local xx,yy = 0,0
    for i=1,9 do
        local jx,jy = self.x+327,self.y+95+xx*24
        bw2:置坐标(jx,jy)
        if self.待选类型选中 ~= i+self.加入1 then
            if  bw2:检查点(x,y) and not tp.消息栏焦点 and self.鼠标 then
                box(jx,jy,jx+100,jy+22,0xFFD0DA68)
                if mouseb(0) then
                    self.待选类型选中 = i+self.加入1
                    self:刷新待选道具(i+self.加入1)
                end
                 if self.资源组[5]:是否选中(x,y) and 引擎.取鼠标滚轮() ==1 and self.加入1 > 0 then--鼠标上滚动
                     self.按钮组[8]:置起始点(self.按钮组[8]:取百分比转换(self.加入1-1,1,#可收购物品))
                 elseif self.资源组[5]:是否选中(x,y)  and 引擎.取鼠标滚轮() ==-1 and self.加入 < #可收购物品-4 then--鼠标下滚动
                     self.按钮组[8]:置起始点(self.按钮组[8]:取百分比转换(self.加入1+1,1,#可收购物品))
                 end
            end
        else
            local col = 0xFF585CDC
            if bw2:检查点(x,y) and not tp.消息栏焦点 and self.鼠标 then
                col = 0xFFA4AC6E
            end
            box(jx,jy,jx+100,jy+22,col)
        end
        if 可收购物品[i+self.加入1] ~= nil then
        zts:置颜色(0xFF202336):显示(jx+4,jy+4,"〉"..可收购物品[i+self.加入1].类型)
        end
        xx = xx + 1
    end
    if #可收购物品 > 9 then
        self.加入1 = math.min(math.ceil((#可收购物品-4)*self.按钮组[8]:取百分比()),#可收购物品)
        if self.加入1 == #可收购物品-4 then
            self.加入1 = self.加入1+1
        end
        self.按钮组[8]:显示(self.x+429,self.y+91,x,y,self.鼠标)
      end


    if self.待选类型选中 ~= 0 or self.搜索 then
        if self.搜索 and #self.待选道具 < 1 then
            zts:置颜色(0xFF202336):显示(self.x+458,self.y+98,"没有搜索到任何相关道具")
        else
            local h = 0
            for i=1,4 do
                if self.待选道具[i+self.加入] ~= nil then
                    local jx,jy = self.x+454,self.y+89+h*55
                    bw1:置坐标(jx,jy)

                    self.资源组[2]:显示(jx,jy)
                    self.待选道具[i+self.加入].小动画:显示(jx-1,jy+2)
                    zts:置颜色(0xFFFFFF01):显示(jx+58,jy+19,self.待选道具[i+self.加入].名称)
                    if self.待选道具选中 == i+self.加入 then
                        self.资源组[3]:显示(jx+3,jy+1)
                    end
                    if bw1:检查点(x,y) and not tp.消息栏焦点 and self.鼠标 then
                        self.焦点 = true
                        self.焦点1 = true
                        self.资源组[4]:显示(jx+3,jy+1)
                         if self.资源组[6]:是否选中(x,y) and 引擎.取鼠标滚轮() ==1 and self.加入 > 0 then--鼠标上滚动
                             self.按钮组[7]:置起始点(self.按钮组[7]:取百分比转换(self.加入-4,4,#self.待选道具))
                         elseif self.资源组[6]:是否选中(x,y)  and 引擎.取鼠标滚轮() ==-1 and self.加入 < #self.待选道具-4 then--鼠标下滚动
                             self.按钮组[7]:置起始点(self.按钮组[7]:取百分比转换(self.加入+4,4,#self.待选道具))
                         end
                        if mouseb(0) and self.待选道具选中 ~= i+self.加入 then
                            self.待选道具选中 = i+self.加入
                        end
                    end
                    if self.待选道具[i+self.加入].重点 ~= nil then
                        box(jx+1,jy+36,jx+51,jy+50,0x7D101010)
                        local xyl = math.floor((52-zts1:取宽度(self.待选道具[i+self.加入].重点))/2)
                        tp.字体表.描边字体12:置颜色(0xFFFFFF00):显示(jx+xyl,jy+35,self.待选道具[i+self.加入].重点)
                    end
                    h = h +1
                end
            end
        end
          if #self.待选道具 > 4 then
            self.按钮组[7]:置高度(min(floor(110/(#self.待选道具-4)),100/2))
            self.加入 = math.min(math.ceil((#self.待选道具-4)*self.按钮组[7]:取百分比()),#self.待选道具)
            if self.加入 == #self.待选道具-4 then
                self.加入 = self.加入+1
            end
            self.按钮组[7]:显示(self.x+603,self.y+113,x,y,self.鼠标)
          end
    end

    self.搜索框:置坐标(self.x+458,self.y+35)
    self.名称输入框:置坐标(self.x+86,self.y+35)
    self.数量输入框:置坐标(self.x+393,self.y+321)
    self.单价输入框:置坐标(self.x+393,self.y+351)
    self.控件类:更新(dt,x,y)
    self.控件类:显示(x,y)
    if tonumber(self.单价输入框:取文本()) ~= nil then
        local 手续费 = math.ceil(tonumber(self.单价输入框:取文本())* 0.05)
        if 手续费 < 5000 then 手续费 = 5000 end
        zts:置颜色(tos(手续费)):显示(self.x+542,self.y+351,手续费)
        zts:置颜色(tos(tonumber(self.单价输入框:取文本())+手续费)):显示(self.x+393,self.y+381,tonumber(self.单价输入框:取文本())+手续费)
        self.数量 = self.单价输入框:取文本()
    end
    zts:置颜色(tos(self.当前银子+0)):显示(self.x+542,self.y+381,self.当前银子)
    --zts:置字间距(0):置颜色(0xFFFFFFFF):显示(self.x+15,self.y+414,"收购物品额外收5%手续费(最低5000)")
    if self.按钮组[7].接触 or self.搜索框._已碰撞 or self.数量输入框._已碰撞 or self.名称输入框._已碰撞 or self.单价输入框._已碰撞 then
        self.焦点 = true
    elseif self.按钮组[8].接触 or self.搜索框._已碰撞 or self.数量输入框._已碰撞 or self.名称输入框._已碰撞 or self.单价输入框._已碰撞 then
        self.焦点 = true
    end
end
function 收购发布:检查点(x,y)
    if self.可视 and self.资源组[1]:是否选中(x,y)  then
        return true
    else
        return false
    end
end

function 收购发布:初始移动(x,y)
    tp.运行时间 = tp.运行时间 + 1
    if not tp.消息栏焦点 then
        self.窗口时间 = tp.运行时间
    end
    if not self.焦点 and (self.按钮组[7]:是否选中(x,y) == false or self.按钮组[8]:是否选中(x,y) == false)  then
        tp.移动窗口 = true
    end
    if self.鼠标 and  not self.焦点 then
        self.xx = x - self.x
        self.yy = y - self.y
    end
end

function 收购发布:开始移动(x,y)
    if self.鼠标 then
        self.x = x - self.xx
        self.y = y - self.yy
    end
end
return 收购发布
